// Aliaws typescript

const appkey = 'FFFF0N0N000000007DAA';
const nc_token = [appkey, (new Date()).getTime(), Math.random()].join(':');


var nc = NoCaptcha.init({
    renderTo: '#silderCheck',
    appkey: appkey,
    scene: 'nc_login_h5',
    token: nc_token,
    trans: {"key1": "code200"},
    elementID: ["usernameID"],
    is_Opt: 0,
    language: "cn",
    timeout: 10000,
    retryTimes: 5,
    errorTimes: 5,
    inline:false,
    apimap: {
        //'analyze': '//a.com/nocaptcha/analyze.jsonp',
        //'uab_Url': '//aeu.alicdn.com/js/uac/909.js',
    },
    bannerHidden:false,
    initHidden:false,
    callback: function (data) {
        document.getElementById('sessionId').innerHTML = data.csessionid;
        document.getElementById('sig').innerHTML = data.sig;
        document.getElementById('token').innerHTML = nc_token;
    },
    error: function (error) {
        console.log(error)
    }
});
NoCaptcha.setEnabled(true);
nc.reset();//请务必确保这里调用一次reset()方法
NoCaptcha.upLang('cn', {
    'LOADING':"加载中...",//加载
    'SLIDER_LABEL': "请按住滑块，拖动到最右边",//等待滑动
    'CHECK_Y':"验证成功",//通过
    // 'ERROR_TITLE':"验证失败",//拦截
    'CHECK_N':"验证未通过", //准备唤醒二次验证
    'OVERLAY_INFORM':"经检测你当前操作环境存在风险，请输入验证码",//二次验证
    'TIPS_TITLE':"验证码错误，请重新输入"//验证码输错时的提示
});
NoCaptcha.upLang('en', {
    'LOADING':"Loading...",//加载
    'SLIDER_LABEL': "Please drag slider to right end",//等待滑动
    'CHECK_Y':"Verify code already sent",//通过
    'ERROR_TITLE':"Verification failed",//拦截
    'CHECK_N':"Sorry please try again", //准备唤醒二次验证
    // 'OVERLAY_INFORM':"Wrong",//二次验证
    // 'TIPS_TITLE':"验证码错误，请重新输入"//验证码输错时的提示
});
